<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位里的层级</title>
    <style>
        div{
            width: 200px;
            height: 200px;
        }
        .box1{
            background: yellow;
            position: relative;
            top: 100px;
            left: 100px;
            z-index: 1;
            /* 层级 */
        }
        .box2{
            background: red;
        }
        /* z-index值越大，层级越大，越靠上显示，可以设负值，前提一定要有定位 */
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>